import datetime

string = '2020-07-01 09:09:09'
time1 = datetime.datetime.strptime(string,'%Y-%m-%d %H:%M:%S')
print (time1)